package com.flex.commands
{
    import com.adobe.cairngorm.business.Responder;
    import com.adobe.cairngorm.commands.Command;
    import com.adobe.cairngorm.control.CairngormEvent;
    import com.flex.business.ServiceDelegate;
    import com.flex.model.ModelLocatorI;
    
    import mx.rpc.events.FaultEvent;

    public class SayHelloCommand implements Command, Responder
    {
    	private var model:ModelLocatorI = ModelLocatorI.getInstance();
    	
        public function SayHelloCommand()
        {
        }

        public function execute(event:CairngormEvent):void
        {
           
            var delegate:ServiceDelegate = new ServiceDelegate(this);
            delegate.sayHello();
        }

        public function onResult(event:* = null):void
        {
            trace("OK");
        }

        public function onFault(event:* = null):void
        {
            var faultEvent:FaultEvent = FaultEvent(event);
            trace("Failed to add template.\n " + faultEvent.fault.faultString);
        }
    }
}